package com.oj.auth.proxy;

import com.oj.api.auth.AuthAPI;
import com.oj.api.auth.domain.UserGroupInfo;
import com.oj.api.auth.service.IUserGroupService;
import com.oj.common.IProxyLayer;
import com.oj.common.InfoPage;
import com.oj.common.exception.BreezeeException;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Bing
 * @since on 2018/5/11
 */
@RestController
@RequestMapping("/" + AuthAPI.BEAN_USER_GROUP_SERVICE)
public class UserGroupServiceProxy implements IUserGroupService, IProxyLayer {

    @Resource(name = AuthAPI.BEAN_USER_GROUP_SERVICE)
    private IUserGroupService target;


    @Override
    public UserGroupInfo saveInfo(@RequestBody UserGroupInfo userGroupInfo) throws BreezeeException {
        return target.saveInfo(userGroupInfo);
    }

    @Override
    public UserGroupInfo findInfoById(@PathVariable("id") String id) throws BreezeeException {
        return target.findInfoById(id);
    }

    @Override
    public List<UserGroupInfo> listInfos(@RequestBody UserGroupInfo userGroupInfo) {
        return target.listInfos(userGroupInfo);
    }

    @Override
    public InfoPage<UserGroupInfo> pageInfos(UserGroupInfo userGroupInfo) {
        return null;
    }

    @Override
    public void deleteInfo(@PathVariable("id") String id) throws BreezeeException {
        target.deleteInfo(id);
    }

    @Override
    public UserGroupInfo addProblemSetToUserGroup(@RequestBody UserGroupInfo userGroupInfo) {
        return target.addProblemSetToUserGroup(userGroupInfo);
    }

    @Override
    public UserGroupInfo addPinCodeToUserGroup(@RequestBody UserGroupInfo userGroupInfo) {
        return target.addPinCodeToUserGroup(userGroupInfo);
    }

    @Override
    public UserGroupInfo deleteProblemSetFromUserGroup(@RequestBody UserGroupInfo userGroupInfo) {
        return target.deleteProblemSetFromUserGroup(userGroupInfo);
    }

    @Override
    public UserGroupInfo deletePinCodeFromUserGroup(@RequestBody UserGroupInfo userGroupInfo) {
        return target.deletePinCodeFromUserGroup(userGroupInfo);
    }

    @Override
    public UserGroupInfo addAccountInfoToUserGroup(@RequestBody UserGroupInfo userGroupInfo) {
        return target.addAccountInfoToUserGroup(userGroupInfo);
    }

    @Override
    public UserGroupInfo deleteUserFromUserGroup(@RequestBody UserGroupInfo userGroupInfo) {
        return target.deleteUserFromUserGroup(userGroupInfo);
    }

    @Override
    public UserGroupInfo expertMarkForGetUserGroupInfo(@PathVariable("code") String code) {
        return target.expertMarkForGetUserGroupInfo(code);
    }
}
